package com.yzd.learnjava.reusing;

import com.yzd.learnjava.util.Print;

public class PlaceSetting extends Custom {
	private Spoon sp ;
	private Fork fork;
	private Knif kn ;
	private DinnerPlate dp ;
	
	public PlaceSetting(int i) {
		super(i + 1);
		sp = new Spoon(i + 2);
		fork = new Fork(i + 3);
		kn = new Knif(i + 4);
		dp = new DinnerPlate(i + 5);
		Print.print("PlateSetting Constructor, i = " + i);
	}

	public static void main(String[] args) {
		PlaceSetting ps = new PlaceSetting(9);
	}

}
class Custom {
	Custom(int i){
		Print.print("Custom Constructor, i = " + i);
	}
}
class Plate{
	Plate(int i){
		Print.print("Plate Constructor, i = " + i);
	}
}

class DinnerPlate extends Plate{
	public DinnerPlate(int i) {
		super(i);
		Print.print("DinnerPlate Constructor , i = " + i);
	}
}

class Utensil{
	public Utensil(int i) {
		// TODO Auto-generated constructor stub
		Print.print("Utensil constructor , i = " + i);
	}
}

class Spoon extends Utensil{
	Spoon(int i){
		super(i);
		Print.print("Spoon constructor, i = " + i);
	}
}

class Fork extends Utensil{
	Fork(int i){
		super(i);
		Print.print("Fork constructor, i = " + i);
	}
}

class Knif extends Utensil{
	Knif(int i){
		super(i);
		Print.print("Knif constructor, i = " + i);
	}
}